/*
 * rfirtc.h
 *
 *  Created on: Nov 29, 2012
 *      Author: andrey
 */

#ifndef RFIRTC_H_
#define RFIRTC_H_

 #include <ch.h>
 #include <hal.h>
#include <time.h>


time_t rtcGetTimeUnixMs(RTCDriver *rtcp);
/**
 * this does not work for any frequency above 100 Hz
 * use chTimeNow()
 */
#define currentTimeMillis() rtcGetTimeUnixMs(&RTCD1)


#endif /* RFIRTC_H_ */
